﻿using System;
using System.Collections;

namespace Moonlite.ExtensionApi
{
    public static class ArrayUtils
    {
        public static string ArrayToStringGeneric(IList array, string delimeter)
        {
            string outputString = "";
            for (int i = 0; i < array.Count; i++)
            {
                if (array[i] is IList)
                {
                    outputString += ArrayToStringGeneric((IList)array[i], delimeter);
                }
                else
                {
                    outputString += array[i];
                }

                if (i != array.Count - 1)
                {
                    outputString += delimeter;
                }
            }

            return outputString;
        }
    }
}
